<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateRecommendsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('recommends', function (Blueprint $table) {


            $table->increments('id');

            $table->string('recommendable_id')->comment('推荐的类型的id');
            $table->string('recommendable_type')->comment('推荐的类型');

            $table->string('cover_url')->nullable()->comment('推荐的封面图片');
            $table->text('description')->nullable()->comment('推荐的描述');

            $table->string('recommend_positions_id')->comment('推荐的位置类型');

            $table->boolean('is_stress')->default(false)->comment('是否重点推荐');

            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('recommends');
    }
}
